<div class="modal fade" id="modalScheduler" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <!-- Modal Header -->
            <div class="modal-header">
                <button type="button" class="close" 
                   data-dismiss="modal">
                       <span aria-hidden="true">&times;</span>
                       <span class="sr-only">关闭</span>
                </button>
                <h4 class="modal-title">
                    <i class="fa fa-plus fa-1x"> </i> <i class="fa fa-desktop"> </i> 添加计划任务
                </h4>
            </div>
            
            <!-- Modal Body -->
            <div class="modal-body">
                
                <form id="modalAddScheduler" class="form-horizontal form-label-left">
                    <div class="x_panel">
                        <div class="x_content">
                            <div class="item form-group">
                                <label class="control-label col-md-3 col-sm-3 col-xs-12" for="kind">类型: <span class="required">*</span></label>
                                <div class="col-md-6 col-sm-6 col-xs-12">
                                <select id="kind" name="kind" class="form-control" required>
                                        <option value="">选择..</option>
                                        <option value="cron">日期</option>
                                        <option value="interval">重复</option>
                                        <option value="date">一次</option>
                                </select>
                                </div>
                            </div>
                            <div id="div_interval_cron" hidden>
                                <div class="item form-group">
                                    <label class="control-label col-md-3 col-sm-3 col-xs-12" for="hour">小时
                                    </label>
                                    <div class="col-md-6 col-sm-6 col-xs-12">
                                        <select id="hour" name="hour" class="form-control" required>
                                        <option value="00">00</option>
                                        <option value="01">01</option>
                                        <option value="02">02</option>
                                        <option value="03">03</option>
                                        <option value="04">04</option>
                                        <option value="05">05</option>
                                        <option value="06">06</option>
                                        <option value="07">07</option>
                                        <option value="08">08</option>
                                        <option value="09">09</option>
                                        <option value="10">10</option>
                                        <option value="11">11</option>
                                        <option value="12">12</option>
                                        <option value="13">13</option>
                                        <option value="14">14</option>
                                        <option value="15">15</option>
                                        <option value="16">16</option>
                                        <option value="17">17</option>
                                        <option value="18">18</option>
                                        <option value="19">19</option>
                                        <option value="20">20</option>
                                        <option value="21">21</option>
                                        <option value="22">22</option>
                                        <option value="23">23</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="item form-group">
                                    <label class="control-label col-md-3 col-sm-3 col-xs-12" for="minute">分钟
                                    </label>
                                    <div class="col-md-6 col-sm-6 col-xs-12">
                                        <select id="minute" name="minute" class="form-control" required>
                                        <option value="00">00</option>
                                        <option value="01">01</option>
                                        <option value="02">02</option>
                                        <option value="05">05</option>
                                        <option value="10">10</option>
                                        <option value="15">15</option>
                                        <option value="20">20</option>
                                        <option value="25">25</option>
                                        <option value="30">30</option>
                                        <option value="35">35</option>
                                        <option value="40">40</option>
                                        <option value="45">45</option>
                                        <option value="50">50</option>
                                        <option value="55">55</option>
                                        </select>
                                    </div>
                                </div>
                            </div>
                            <div id="div_date" hidden>
                                <div class="item form-group">
                                    <label class="control-label col-md-3 col-sm-3 col-xs-12" for="date">日期
                                    </label>
                                    <div class="col-md-6 col-sm-6 col-xs-12">
                                        <input type="text" class="form-control has-feedback-left" id="datePicker" />
                                        <span class="fa fa-calendar-o form-control-feedback left" aria-hidden="true"></span>
                                    </div>
                                </div>
                            </div>
                            <div class="item form-group">
                                <label class="control-label col-md-3 col-sm-3 col-xs-12" for="action">操作: <span class="required">*</span></label>
                                <div class="col-md-6 col-sm-6 col-xs-12">
                                    <select id="action" name="action" class="form-control" onchange="hiddenFields(this)" required>
                                        <option value="">选择..</option>
                                    </select>
                                </div>
                            </div>
                            <div class="x_panel">
                                <div class="x_content">
                                    <h4 id="actionTitle"></h4>
                                    <div id="div_action_form">
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
            <!-- Modal Footer -->
            <div class="modal-footer">
                <ul class="nav navbar-left panel_toolbox">
                <li><button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button></li>
                </ul>
                <ul class="nav navbar-right panel_toolbox">
                    <button id="send" type="button" class="btn btn-success">添加任务</button></li>
                </ul>
            </div>
        </div>
    </div>
</div>

<script>
function hiddenFields(obj) {
    action=obj.value;
    $('.hidden-field').hide();
    $('.'+action).show();
}
</script>

<div class="modal fade" id="modalUpload" tabindex="-1" role="dialog" 
     aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <!-- Modal Header -->
            <div class="modal-header">
                <button type="button" class="close" 
                   data-dismiss="modal">
                       <span aria-hidden="true">&times;</span>
                       <span class="sr-only">关闭</span>
                </button>
                <h4 class="modal-title">
                    <i class="fa fa-plus fa-1x"> </i> <i class="fa fa-desktop"> </i>上传备份
                </h4>
            </div>

            <!-- Modal Body -->
            <div class="modal-body">

                <div class="row">
                  <div class="col-md-12 col-sm-12 col-xs-12">
                    <div class="x_panel">
                      <div class="x_title">
                        <h4>备份拖放上传</h4>
                        <div class="clearfix"></div>
                      </div>
                      <div class="x_content">
                        <p>将多个文件拖到下面的框中进行多文件上传或单击选择文件.</p>
                        <form action="{{ url_for('admin_backup_upload') }}" class="dropzone"></form>
                        <br />
                      </div>
                    </div>
                  </div>
                </div>

            </div>
        </div>
    </div>
</div>


<div class="modal fade" id="modalBackupInfo" tabindex="-1" role="dialog" 
     aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog" style="width:800px">
        <div class="modal-content">
            <!-- Modal Header -->
            <div class="modal-header">
                <button type="button" class="close" 
                   data-dismiss="modal">
                       <span aria-hidden="true">&times;</span>
                       <span class="sr-only">关闭</span>
                </button>
                <h4 class="modal-title">
                    <i class="fa fa-plus fa-1x"> </i> <i class="fa fa-desktop"> </i> 备份信息
                </h4>
            </div>
            
            <!-- Modal Body -->
            <div class="modal-body">
                
<!--
              <form id="modalAddBackupInfo" class="form-horizontal form-label-left">
-->
            <ul class="nav navbar-right panel_toolbox">
<!--
                <li><a class="btn-bulk-restore"><span style="color: #5499c7; "><i class="fa fa-plus"></i> Restore table</span></a>
               </li>
-->
            </ul>
              <div class="x_panel">
                 <div class="x_content">
                     <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="kind">表: <span class="required">*</span></label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                           <select id="backup-tables" name="backup-tables" class="form-control" required>
                           </select>
                        </div>
                     </div> 
                 </div>
              </div>

    
            <!-- Modal Footer -->
            <div class="modal-footer">
                <input id="backup-id" type="hidden" value=''>
                <table id="backup-table-detail" class="display" width="100%">
                    <thead>
                      <tr>
                         <th>ID</th>
                         <th>存在</th>
                         <th>恢复</th>
                      </tr>
                   </thead>
                </table>
            </div>
        </div>
        </div>
    </div>
</div>
